package com.example.shopping.mapper;

import com.example.shopping.model.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author duoliang.zhang
 * @since 2021/6/25 14:29
 */
@Mapper
public interface ProductMapper {
    @Select("select * from t_product")
    List<Product> findAll();

    @Delete("delete from t_product where id = {id} limit 1")
    boolean deleteById(@Param("id") Long id);
}
